﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Data.Services.Common;
using Ebt.Linq;

namespace Service.Model
{
	[DataServiceKey(new[] { "ID", "StateID" })]
	[Table("City")]
    [FederationKey("StateID")]
	public class City
	{
		[Key]
		[Column(Order = 0)]
		public Int64 ID { get; set; }
		[Key]
		[Column(Order = 3)]
		[ForeignKey("County")]
		public Int64 StateID { get; set; }
		[Column(Order = 1)]
		public string Name { get; set; }
		[Column(Order = 2)]
		[ForeignKey("County")]
		public Int64 CountyID { get; set; }

		[ForeignKey("StateID")]
		[InverseProperty("Cities")]
		public State State { get; set; }

		[InverseProperty("Cities")]
		public County County { get; set; }
	}
}